package org.dizena.modules.master.bean;

import com.alibaba.fastjson2.annotation.JSONField;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.Document;

import java.io.Serializable;

@Document(collection = "master_user")
@NoArgsConstructor
@Data
public class User implements Serializable
{

    private static final long serialVersionUID = -4490642721851851016L;
    @Id
    private String id;

    /**
     * 一般是手机号
     */
    @Indexed
    private String account;
    private String nickname;
    private String roles;
    private String auths;
    private Integer locked;

    private String passwd;
    private String salt;

    private String pic;
    private String sex;
    private String city;

    private String token;

    private Long createTime;
    private Long updateTime;
    private Long lastLoginTime;

    @JSONField(serialize = false)
    private String trueName;
    private transient String mobile;
    private String homeAddress;
    private String description;
    private String hobby;

    public User(String id, String account, String passwd, String salt, String nickname, String roles, String auths, String token, Integer locked, Long createTime, Long updateTime)
    {
        super();
        this.id = id;
        this.account = account;
        this.passwd = passwd;
        this.salt = salt;
        this.nickname = nickname;
        this.roles = roles;
        this.auths = auths;
        this.token = token;
        this.locked = locked;
        this.createTime = createTime;
        this.updateTime = updateTime;
    }

}
